// JavaScript Document
function getxmlhttp() {
	var xmlhttp = false;
	
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
		try{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch(e) {
			xmlhttp = false;
		}
	}
	
	if(!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	
	return xmlhttp;
}

function processajax(serverPage, obj, getOrPost, str) {
	xmlhttp = getxmlhttp();
	if(getOrPost == "get") {	
	} else {
		xmlhttp.open("POST", serverPage, true);
		xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
		xmlhttp.onreadystatechange = function() {
			if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
				obj.innerHTML = xmlhttp.responseText;
			}
		}
		xmlhttp.send(str);
	}
}

function submitform(theform, serverPage, objID, valfunc) {
	var file = serverPage;
	var tf = hj$(theform);
	obj = hj$(objID);
	var str = '';
	var val;
	for(var i=0;i<tf.elements.length;i++) {
		if((tf.elements[i].type == 'radio' && !tf.elements[i].checked) || tf.elements[i].value == '') { continue;}
		str += tf.elements[i].name + "=" + escape(tf.elements[i].value) + "&";
	}
	processajax(serverPage, obj, "post", str);
}